<template>
    <div>
        <div style="display: flex;">
            <div style="margin: 0 30px;">
            <el-button type="primary" @click="handleButtonAdd()">+ 添加</el-button>
        </div>
        <div>
            <el-select v-model="wd_id" placeholder="请选择"  @change="selectType">
                <el-option v-for="(item, index) in typeList" :key="index" :label="item.type" :value="item.id">
                </el-option>
            </el-select>
        </div>
        <div>
            <el-select v-model="ball_id" placeholder="请选择"  @change="changeBall">
                <el-option v-for="(item, index) in ballList" :key="index" :label="item.type" :value="item.id">
                </el-option>
            </el-select>
        </div>
        </div>

        <el-table :data="matchAI" style="width: 100%" :header-cell-style="{ 'text-align': 'center' }">
            <el-table-column prop="id" label="ID" align="center">

            </el-table-column>
            
            <el-table-column prop="create_time" label="创建时间" align="center">
            </el-table-column>
            <el-table-column prop="update_time" label="更新时间" align="center">
            </el-table-column>
            <el-table-column prop="teamA" label="主队" align="center">
            </el-table-column>
            <el-table-column prop="teamB" label="客队" align="center">
            </el-table-column>
            <template v-if="ball_id == 2">
                <el-table-column prop="total_score" label="预计总分" align="center">
            </el-table-column>
            <el-table-column prop="goalLine" label="让球分" align="center">
            </el-table-column>
            </template>
            <el-table-column prop="browse" label="是否有人查看" align="center">
                <template slot-scope="scope">
                    <span v-if="scope.row.browse == 0">
                        否
                    </span>
                    <span v-else>
                        {{scope.row.browse}}
                    </span>
                </template>
            </el-table-column>

            <el-table-column label="操作" align="center">
                <template slot-scope="scope">
                    <el-button size="small" type="primary" v-if="!scope.row.browse" @click="handleButton1Click(scope.row)">修改</el-button>
                    <el-button size="small" type="danger" @click="handleButton2Click(scope.row)">删除</el-button>
                    <el-button size="small" type="warning" @click="handleButton3Click(scope.row)">更新赔率</el-button>

                </template>
            </el-table-column>
        </el-table>

        <div class="tabListPage">
            <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
                :current-page="currentPage" :page-sizes="pageSizes" :page-size="PageSize"
                layout="total, sizes, prev, pager, next, jumper" :total="totalCount">
            </el-pagination>
        </div>

        <div>
            <el-dialog title="添加" :visible.sync="dialogTableVisible" :before-close="closeForm"
                :close-on-click-modal="false" :close-on-press-escape="false">
                <!-- <div>
                    <span style="display: inline-block;">
                        <el-input style="margin-right: 20px;" v-model="zhuName" placeholder="请输入主队全称"></el-input>
                    </span>
                    <span style="margin: 20px 20px;display: inline-block;">
                        <el-input style="margin-right: 20px;" v-model="keName" placeholder="请输入客队全称"></el-input>
                    </span>
                    <div @click="upOdds" style="margin: 0 0 20px 0;">点击更新赔率(无法获取赔率时使用)</div>
                </div> -->

                <el-form :model="ruleForm" ref="ruleForm" label-width="100px" class="demo-ruleForm">
                    <el-form-item label="选择类型" prop="name">
                        <el-select v-model="ruleForm.typeid" placeholder="请选择" @change="selectChange">
                            <el-option v-for="(item, index) in typeList" :key="index" :label="item.type"
                                :value="item.id">
                            </el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="选择分类" prop="name">
                        <el-select v-model="ballID" placeholder="请选择" @change="selectBall">
                            <el-option v-for="(item, index) in ballList" :key="index" :label="item.type"
                                :value="item.id">
                            </el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="赛事选择">
                        <!-- <el-select v-model="ruleForm.matchid" placeholder="请选择" @change="selectMatch">
                            <el-option v-for="(item, index) in matchList" :key="index" :label="item.away_name+'vs'+item.home_name" :value="item.id"></el-option>
                        </el-select> -->
                        <el-input style="margin-right: 20px;" v-model="home_name" placeholder="请输入主队名称" @input="getMatchList()"></el-input>
                    </el-form-item>
                    <el-form-item>
                        <div style="display: flex;flex-wrap: wrap;" v-if="ruleForm.typeid==1">
                            <div v-if="ballID==1">
                                <div v-for="(items, index) in teamMatch" :key="index" class="fourteenClass" @click.stop="toChange(items.match_id, items)">
                                    <div>
                                        <span>{{ items.home_team_name }} VS {{ items.away_team_name }}</span>
                                    </div>
                                    <div class="box">
                                        <div class="fourteenClass_a" v-for="(item, i) in oddsData"
                                            :key="i" @click.stop="onSelect1(item,i)" :class="selectIndex==i?'item1':''">
                                            <!-- :class="{ 'item1': item.is_recommend }" -->
                                            <!-- :class="selectIndex==i?'item1':''" -->
                                            <span>{{ item.label }}</span>
                                            <span>{{ item.value }}</span>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div v-if="ballID==2">
                                <!-- <span>这是篮球ai寻胆</span> -->
                                <div class="box" v-if="showOddsNull!=1">
                                        
                                        <div v-for="(items, index) in teamMatch" :key="index" class="fourteenClass" @click.stop="toChange(items.match_id, items)">
                                    <div>
                                        <span>{{ items.away_team_name }} VS {{ items.home_team_name }}</span>
                                    </div>
                                    <div class="box" style="display: flex;flex-direction: column;">
                                        <!-- oddsData -->
                                        <div>赛事推荐</div>
                                        <div style="display: flex;">
                                            <div class="bask_class" v-for="(item, i) in baskData"
                                            :key="i" @click.stop="onSelectBask(item,i)" :class="selectIndexBask==i?'item1':''">
                                            <!-- :class="{ 'item1': item.is_recommend }" -->
                                            <!-- :class="selectIndex==i?'item1':''" -->
                                            <span>{{ item.label }}</span>
                                            <span>{{ item.value }}</span>
                                        </div>
                                        </div>
                                    </div>
                                </div>
                                    </div>
                                    <div v-else>
                                        <div v-for="(items, index) in teamMatch" :key="index" class="fourteenClass" @click.stop="toChange(items.match_id, items)">
                                    <div>
                                        <span>{{ items.away_team_name }} VS {{ items.home_team_name }}</span>
                                    </div>
                                    <div class="box" style="display: flex;flex-direction: column;">
                                        <div>赛事推荐</div>
                                        <div style="display: flex;">
                                            <!-- ballOdds:[{label:'胜',is_recommend:false},{label:'负',is_recommend:false}], -->
                                            <div class="bask_class" v-for="(item, i) in ballOdds" :key="i" @click.stop="onSelectBask(item,i)" :class="selectIndexBask==i?'item1':''">
                                            <!-- :class="{ 'item1': item.is_recommend }" -->
                                            <!-- :class="selectIndex==i?'item1':''" -->
                                            <span v-if="i!=1">{{ item.label }}</span>
                                            <el-input v-if="i==1" style="margin-right: 20px;" v-model="rangfen"  placeholder="让分"></el-input>
                                        </div>
                                        </div>
                                    </div>
                                </div>
                                        
                                    </div>
                                    
                                    <div v-if="showType==true">
                                        <div class="box" style="display: flex;flex-direction: column;">
                                        <div>大小分推荐</div>
                                        <div style="display: flex;">
                                            <div class="bask_class" v-for="(item, i) in bigSmallData" :key="i" @click.stop="onSelectBaskScore(item,i)" :class="selectBaskScore==i?'item1':''">
                                            <!-- :class="{ 'item1': item.is_recommend }" -->
                                            <!-- :class="selectIndex==i?'item1':''" -->
                                            <span v-if="i!=1">{{ item.label }}</span>
                                            <span v-if="i!=1">{{ item.value }}</span>
                                            <el-input v-if="i==1" style="margin-right: 20px;" v-model="item.value"  placeholder="大小分"></el-input>
                                        </div>
                                        </div>
                                    </div>
                                    </div>
                                    <div v-else>
                                        <div class="box" style="display: flex;flex-direction: column;">
                                        <div>大小分推荐</div>
                                        <div style="display: flex;">
                                            <div class="bask_class" v-for="(item, i) in baskBigsmall" :key="i" @click.stop="onSelectBaskScore(item,i)" :class="selectBaskScore==i?'item1':''">
                                            <!-- :class="{ 'item1': item.is_recommend }" -->
                                            <!-- :class="selectIndex==i?'item1':''" -->
                                            <span v-if="i!=1">{{ item.label }}</span>
                                            <el-input v-if="i==1" style="margin-right: 20px;" v-model="item.value"  placeholder="大小分"></el-input>
                                        </div>
                                        </div>
                                    </div>
                                    </div>
                                    
                            </div>
                            </div>
                            <div style="display: flex;flex-wrap: wrap;" v-if="ruleForm.typeid==2">
                                <div v-if="ballID==1">
                                    <div v-for="(items, index) in teamMatch" :key="index" class="fourteenClass" @click.stop="toChange(items.match_id, items)">
                                    <div>
                                        <span>{{ items.home_team_name }} VS {{ items.away_team_name }}</span>
                                    </div>
                                    <div class="box">
                                        <div class="fourteenClass_a" v-for="(item, i) in oddsData"
                                            :key="i" @click.stop="onSelect1(item,i)" :class="{ 'item1': item.is_recommend }">
                                            <!-- :class="{ 'item1': item.is_recommend }" -->
                                            <!-- :class="selectIndex==i?'item1':''" -->
                                            <span>{{ item.label }}</span>
                                            <span>{{ item.value }}</span>
                                        </div>
                                    </div>
                                </div>
                                </div>
                                <div v-if="ballID==2">
                                    <!-- <span>这是篮球冷门预警</span> -->
                                    <div class="box">
                                        
                                        <div v-for="(items, index) in teamMatch" :key="index" class="fourteenClass" @click.stop="toChange(items.match_id, items)">
                                    <div>
                                        <span>{{ items.away_team_name }} VS {{ items.home_team_name }}</span>
                                    </div>
                                    <div class="box" style="display: flex;flex-direction: column;">
                                        <!-- oddsData -->
                                        <div>赛事推荐</div>
                                        <div style="display: flex;">
                                            <div class="bask_class" v-for="(item, i) in baskData"
                                            :key="i" @click.stop="onSelectBask(item,i)" :class="selectIndexBask==i?'item1':''">
                                            <!-- :class="{ 'item1': item.is_recommend }" -->
                                            <!-- :class="selectIndex==i?'item1':''" -->
                                            <span>{{ item.label }}</span>
                                            <span>{{ item.value }}</span>
                                        </div>
                                        </div>
                                    </div>
                                </div>
                                    </div>

                                    <div class="box" style="display: flex;flex-direction: column;">
                                        <div>
                                            <div>胜分差推荐</div>
                                            <el-radio v-model="horA" label="1">主胜</el-radio>
                                            <el-radio v-model="horA" label="2">客胜</el-radio>
                                        </div>
                                        <div style="display: flex;">
                                            <div class="bask_class" v-for="(item, i) in home_winning" :key="i" :class="{ 'item1': selectedItems.includes(item.id) }" style="display: flex;flex-direction: column;" @click="toggleSelect(item.id,item)">
                                            <!-- :class="{ 'item1': item.is_recommend }" -->
                                            <!-- :class="selectIndex==i?'item1':''" -->
                                            <span >{{ item.label }}</span>
                                        </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                    </el-form-item>
                    <el-form-item label="参数填写">
                        <div v-if="ballID==1">
                            <div class="cs_class" v-if="ruleForm.typeid==1">
                            <el-input style="margin-right: 20px;" v-model="ruleForm.cs1" placeholder="积分优势"></el-input>
                            <el-input style="margin-right: 20px;" v-model="ruleForm.cs2" placeholder="状态优势"></el-input>
                            <el-input style="margin-right: 20px;" v-model="ruleForm.cs3" placeholder="排名优势"></el-input>
                            <el-input style="margin-right: 20px;" v-model="ruleForm.cs4" placeholder="交锋优势"></el-input>
                            <el-input v-model="ruleForm.cs5" placeholder="主场交锋优势"></el-input>
                        </div>
                        <div class="cs_class" v-if="ruleForm.typeid==2">
                            <el-input style="margin-right: 20px;" v-model="ruleForm.cs6" placeholder="历史爆冷"></el-input>
                            <el-input style="margin-right: 20px;" v-model="ruleForm.cs7" placeholder="市场洞察"></el-input>
                            <el-input style="margin-right: 20px;" v-model="ruleForm.cs8" placeholder="指数透析"></el-input>
                            <el-input style="margin-right: 20px;" v-model="ruleForm.cs9" placeholder="动态实力"></el-input>
                            <el-input v-model="ruleForm.cs10" placeholder="战意状态"></el-input>
                        </div>
                        </div>
                        <div v-else>
                            <div class="cs_class" v-if="ruleForm.typeid==1">
                            <el-input style="margin-right: 20px;" v-model="ruleForm.cs1" placeholder="积分优势"></el-input>
                            <el-input style="margin-right: 20px;" v-model="ruleForm.cs2" placeholder="状态优势"></el-input>
                            <el-input style="margin-right: 20px;" v-model="ruleForm.cs3" placeholder="排名优势"></el-input>
                            <el-input style="margin-right: 20px;" v-model="ruleForm.cs4" placeholder="交锋优势"></el-input>
                            <el-input v-model="ruleForm.cs5" placeholder="主场交锋优势"></el-input>
                        </div>
                        <div class="cs_class" v-if="ruleForm.typeid==2">
                            <el-input style="margin-right: 20px;" v-model="ruleForm.cs1" placeholder="历史爆冷"></el-input>
                            <el-input style="margin-right: 20px;" v-model="ruleForm.cs2" placeholder="市场洞察"></el-input>
                            <el-input style="margin-right: 20px;" v-model="ruleForm.cs3" placeholder="指数透析"></el-input>
                            <el-input style="margin-right: 20px;" v-model="ruleForm.cs4" placeholder="动态实力"></el-input>
                            <el-input v-model="ruleForm.cs5" placeholder="战意状态"></el-input>
                        </div>
                        </div>
                    </el-form-item>
                    

                    <el-form-item label="非竞彩参数填写" v-if="ballID==2">


                        <div >
                            <div class="cs_class" v-if="ruleForm.typeid==1">
                            <el-input style="margin-right: 20px;" v-model="ruleForm.goalLine" placeholder="让分举例 +0.5 -0.5"></el-input>
                        </div>

                        <div class="cs_class" v-if="ruleForm.typeid==2">
                            <el-input style="margin-right: 20px;" v-model="ruleForm.total_score" placeholder="总分"></el-input>
                            <el-input style="margin-right: 20px;" v-model="ruleForm.goalLine" placeholder="让分举例 +0.5 -0.5"></el-input>
                        </div>
                        
                        
                        </div>
                    </el-form-item>

                   

                    <el-form-item label="爆冷系数" v-if="ruleForm.typeid==2">
                        <el-input style="margin-right: 20px;" v-model="ruleForm.coefficient" placeholder="爆冷系数"></el-input>
                    </el-form-item>
                    <el-form-item label="比分预测" v-if="ruleForm.typeid==2&&this.ballID!=2">
                        <div class="cs_class" style="margin-bottom: 20px;">
                            <el-input style="margin-right: 20px;" v-model="ruleForm.score1" placeholder="比分预测1"></el-input>
                        </div>
                        <div class="cs_class">
                            <el-input style="margin-right: 20px;" v-model="ruleForm.score2" placeholder="比分预测2"></el-input>
                        </div>
                    </el-form-item>
                    <el-form-item label="是否修改比分" v-if="ruleForm.typeid==2">
                        <el-radio-group v-model="ruleForm.Mscore">
                            <el-radio :label="1">是</el-radio>
                            <el-radio :label="2">否</el-radio>
                        </el-radio-group>
                    </el-form-item>
                    <!-- <el-form-item style="margin-top: 10px;" label="排序" prop="name">
                        <el-input v-model="ruleForm.sort"></el-input>
                    </el-form-item> -->
                    <el-form-item label="是否置顶">
                        <el-radio-group v-model="ruleForm.plnned">
                            <el-radio :label="1">是</el-radio>
                            <el-radio :label="2">否</el-radio>
                        </el-radio-group>
                    </el-form-item>
                    <el-form-item label="显示时间">
                        <el-date-picker type="datetime" v-model="renderDate"></el-date-picker>

                        </el-form-item>
                    <el-form-item label="是否执行红黑">
                        <el-radio-group v-model="ruleForm.exec_hh">
                            <el-radio :label="1">是</el-radio>
                            <el-radio :label="2">否</el-radio>
                        </el-radio-group>
                    </el-form-item>
                </el-form>
                <div style="text-align: right;">
                    <el-button @click="dialogTableVisible = false">取消</el-button>
                    <el-button type="primary" @click="clickConfirm(1)">确认</el-button>
                </div>
            </el-dialog>
        </div>


        <div>
            <el-dialog title="修改" :visible.sync="dialogTrue" :before-close="closedModel"
                :close-on-click-modal="false" :close-on-press-escape="false">
                <el-form :model="modifyData" ref="modifyData" label-width="100px" class="demo-ruleForm">
                    <el-form-item label="选择类型" prop="name">
                        <el-select v-model="modify_id" placeholder="请选择" @change="selectChange">
                            <el-option v-for="(item, index) in typeList" :key="index" :label="item.type"
                                :value="item.id">
                            </el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item>
                        <div v-if="ball_id==1">
                            <span>{{ modifyData.teamA }} VS {{ modifyData.teamB }}</span>
                        </div>
                        <div v-if="ball_id==2">
                            <span>{{ modifyData.teamB }} VS {{ modifyData.teamA }}</span>
                        </div>



                        <!-- <div v-if="wd_id==1">

                        </div> -->



                        <div v-if="ball_id==1">
                            <div class="box" v-if="ruleForm.typeid==2">
                            <div class="fourteenClass_a" v-for="(item, i) in modifyOdds"
                                :key="i" @click.stop="onSelect2(item,i)" :class="{ 'item1': item.is_recommend }">
                                            <!-- :class="{ 'item1': item.is_recommend }" -->
                                            <!-- :class="selectIndex==i?'item1':''" -->
                                <span>{{ item.label }}</span>
                            </div>
                        </div>
                        <div class="box" v-if="ruleForm.typeid==1">
                            <div class="fourteenClass_a" v-for="(item, i) in modifyOdds"
                                :key="i" @click.stop="onSelect2(item,i)" :class="selectIndex==i?'item1':''">
                                            <!-- :class="{ 'item1': item.is_recommend }" -->
                                            <!-- :class="selectIndex==i?'item1':''" -->
                                <span>{{ item.label }}</span>
                            </div>
                        </div>
                        </div>
                        <div v-if="ball_id==2">
                            <div class="box" v-if="ruleForm.typeid==2" style="display: flex;flex-direction: column;">
                                <div class="box" style="display: flex;flex-direction: column;">
                                <div>赛事推荐</div>
                                <div style="display: flex;">
                                    <div class="bask_class" v-for="(item, i) in ballOdds"
                                :key="i" @click.stop="onSelectBask(item,i)" :class="selectIndexBask==i?'item1':''">
                                            <!-- :class="{ 'item1': item.is_recommend }" -->
                                            <!-- :class="selectIndex==i?'item1':''" -->
                                <span>{{ item.label }}</span>
                            </div>
                                </div>
                            </div>

                            <div class="box" style="display: flex;flex-direction: column;">
                                        <div>胜分差推荐</div>
                                        <div style="display: flex;">
                                            <div class="bask_class" v-for="(item, i) in home_winning" :key="i" :class="{ 'item1': selectedItems.includes(item.id) }" style="display: flex;flex-direction: column;" @click="toggleSelect(item.id,item)">
                                            <!-- :class="{ 'item1': item.is_recommend }" -->
                                            <!-- :class="selectIndex==i?'item1':''" -->
                                            <span >{{ item.label }}</span>
                                        </div>
                                        </div>
                                    </div>

                        </div>


                        





                        <div class="box" v-if="ruleForm.typeid==1" style="display: flex;flex-direction: column;">
                            <div class="box" style="display: flex;flex-direction: column;">
                                <div>赛事推荐</div>
                                <div style="display: flex;">
                                    <div class="bask_class" v-for="(item, i) in ballOdds"
                                :key="i" @click.stop="onSelectBask(item,i)" :class="selectIndexBask==i?'item1':''">
                                            <!-- :class="{ 'item1': item.is_recommend }" -->
                                            <!-- :class="selectIndex==i?'item1':''" -->
                                <span>{{ item.label }}</span>
                            </div>
                                </div>
                            </div>

                            

                            <div class="box" style="display: flex;flex-direction: column;">
                                        <div>大小分推荐</div>
                                        <div style="display: flex;">
                                            <div class="bask_class" v-for="(item, i) in bigSmallData" :key="i" @click.stop="onSelectBaskScore(item,i)" :class="selectBaskScore==i?'item1':''">
                                            <!-- :class="{ 'item1': item.is_recommend }" -->
                                            <!-- :class="selectIndex==i?'item1':''" -->
                                            <span v-if="i!=1">{{ item.label }}</span>
                                            <span v-if="i!=1">{{ item.value }}</span>
                                            <el-input v-if="i==1" style="margin-right: 20px;" v-model="item.value"  placeholder="大小分"></el-input>
                                        </div>
                                        </div>
                                    </div>
                        </div>
                        </div>
                    </el-form-item>


                    <el-form-item label="参数填写">
                        <div v-if="ball_id==1">
                            <div class="cs_class" v-if="wd_id==1">
                            <el-input style="margin-right: 20px;" v-model="modifyData.point_advantage" placeholder="积分优势"></el-input>
                            <el-input style="margin-right: 20px;" v-model="modifyData.form_advantage" placeholder="状态优势"></el-input>
                            <el-input style="margin-right: 20px;" v-model="modifyData.ranking_advantage" placeholder="排名优势"></el-input>
                            <el-input style="margin-right: 20px;" v-model="modifyData.head_to_head_advantage" placeholder="交锋优势"></el-input>
                            <el-input v-model="modifyData.home_head_to_head_advantage" placeholder="主场交锋优势"></el-input>
                        </div>
                        <div class="cs_class" v-if="wd_id==2">
                            <el-input style="margin-right: 20px;" v-model="modifyData.historical_upset" placeholder="历史爆冷"></el-input>
                            <el-input style="margin-right: 20px;" v-model="modifyData.market_insight" placeholder="市场洞察"></el-input>
                            <el-input style="margin-right: 20px;" v-model="modifyData.index_analysis" placeholder="指数透析"></el-input>
                            <el-input style="margin-right: 20px;" v-model="modifyData.dynamic_strength" placeholder="动态实力"></el-input>
                            <el-input v-model="modifyData.fighting_spirit" placeholder="战意状态"></el-input>
                        </div>
                        </div>
                        <div v-else>
                            <div class="cs_class" v-if="wd_id==1">
                            <el-input style="margin-right: 20px;" v-model="modifyData.point_advantage" placeholder="积分优势"></el-input>
                            <el-input style="margin-right: 20px;" v-model="modifyData.form_advantage" placeholder="状态优势"></el-input>
                            <el-input style="margin-right: 20px;" v-model="modifyData.ranking_advantage" placeholder="排名优势"></el-input>
                            <el-input style="margin-right: 20px;" v-model="modifyData.head_to_head_advantage" placeholder="交锋优势"></el-input>
                            <el-input v-model="modifyData.home_head_to_head_advantage" placeholder="主场交锋优势"></el-input>
                        </div>
                        <div class="cs_class" v-if="wd_id==2">
                            <el-input style="margin-right: 20px;" v-model="modifyData.point_advantage" placeholder="历史爆冷"></el-input>
                            <el-input style="margin-right: 20px;" v-model="modifyData.form_advantage" placeholder="市场洞察"></el-input>
                            <el-input style="margin-right: 20px;" v-model="modifyData.ranking_advantage" placeholder="指数透析"></el-input>
                            <el-input style="margin-right: 20px;" v-model="modifyData.head_to_head_advantage" placeholder="动态实力"></el-input>
                            <el-input v-model="modifyData.home_head_to_head_advantage" placeholder="战意状态"></el-input>
                        </div>
                        </div>
                    </el-form-item>
                    <el-form-item label="爆冷系数" v-if="wd_id==2">
                        <el-input style="margin-right: 20px;" v-model="modifyData.coefficient" placeholder="爆冷系数"></el-input>
                    </el-form-item>
                    <el-form-item label="比分预测" v-if="wd_id==2&&ball_id!=2">
                        <div class="cs_class" style="margin-bottom: 20px;">
                            <el-input style="margin-right: 20px;" v-model="modifyData.predicted_scoreA" placeholder="比分预测1"></el-input>
                        </div>
                        <div class="cs_class">
                            <el-input style="margin-right: 20px;" v-model="modifyData.predicted_scoreB" placeholder="比分预测2"></el-input>
                        </div>
                    </el-form-item>
                    <el-form-item label="是否修改比分" v-if="modify_id==2">
                        <el-radio-group v-model="ruleForm.Mscore">
                            <el-radio :label="1">是</el-radio>
                            <el-radio :label="2">否</el-radio>
                        </el-radio-group>
                    </el-form-item>
                    <el-form-item label="是否置顶">
                        <el-radio-group v-model="modifyData.if_pinned">
                            <el-radio :label="1">是</el-radio>
                            <el-radio :label="2">否</el-radio>
                        </el-radio-group>
                    </el-form-item>
                    <el-form-item label="显示时间">
                        <el-date-picker type="datetime" v-model="renderDate"></el-date-picker>

                        </el-form-item>
                </el-form>
                <div style="text-align: right;">
                    <el-button @click="dialogTrue = false">取消</el-button>
                    <el-button type="primary" @click="modifyConfirm(1)">确认</el-button>
                </div>
            </el-dialog>
        </div>




        <el-dialog title="修改" :visible.sync="dialogTrue1" :before-close="closedModel1"
                :close-on-click-modal="false" :close-on-press-escape="false">
                

                <el-form :model="updateForm" ref="updateForm" label-width="100px" class="demo-ruleForm">
                    <el-form-item label="主队名称" prop="name1">

                        <el-input style="margin-right: 20px;" v-model="updateForm.name1" placeholder="输入主队名称"></el-input>
                        
                        

                    </el-form-item>
                     <el-form-item label="客队名称" prop="name2">

                        <el-input style="margin-right: 20px;" v-model="updateForm.name2" placeholder="输入主队名称"></el-input>
                        
                        

                    </el-form-item>
                  </el-form>


                <div style="text-align: right;">
                    <el-button @click="closedModel1">取消</el-button>
                    <el-button type="primary" @click="modifyConfirm1">确认</el-button>
                </div>
            </el-dialog>

    </div>
</template>

<script>
import {hqMatcheList,hqOddsData,aiPlayList,aiListDelete,aiSaveData,baskList,baskListDelete,baskListSave,baskListOdds,footUpOdds,baskUpOdd,updateOdds,updateOdds1 } from '../../../libs/api'
import data from '../pdf/content'
export default{
    data() {
        return{
            dialogTrue1:false,
            bigSmall:'',
            modifyOdds:[{label:'主胜',is_recommend:false,value:''},{label:'平',is_recommend:false,value:''},{label:'主负',is_recommend:false,value:''}],
            ballOdds:[{label:'胜',is_recommend:false},{},{label:'负',is_recommend:false}],
            baskBigsmall:[{label:'小',is_recommend:false},{},{label:'大',is_recommend:false}],
            home_winning:[{label:'1-5',value:'7.70',id: 1},{label:'6-10',value:'7.70',id: 2},{label:'11-15',value:'7.70',id: 3},{label:'16-20',value:'7.70',id: 4},{label:'21-25',value:'7.70',id: 5},{label:'26+',value:'7.70',id: 6}],
            away_winning:[{label:'1-5',value:'2.70'},{label:'6-10',value:'2.70'},{label:'11-15',value:'2.70'},{label:'16-20',value:'2.70'},{label:'21-25',value:'2.70'},{label:'26+',value:'2.70'}],
            baskData:[],
            bigSmallData:[],
            typeList:[{type:'稳胆',id:1},{type:'爆冷',id:2}],
            ruleForm:{
                typeid:1,
                matchid:'',
                cs1:'',
                cs2:'',
                cs3:'',
                cs4:'',
                cs5:'',
                cs6:'',
                cs7:'',
                cs8:'',
                cs9:'',
                cs10:'',
                sort:'',
                exec_hh:2,
                plnned:2,
                score1:'',
                score2:'',
                Mscore:2,
                goalLine: '',
                total_score: ''
            },
            dialogTableVisible:false,
            dialogTrue:false,
            matchList:[
                {away_name:"桑德兰",home_name:"谢周三",id:1023},
                {away_name:"加的夫",home_name:"阿斯顿维拉",id:1024},
                {away_name:"拜仁",home_name:"斯图加",id:1025},
                {away_name:"菲尔特",home_name:"杜塞尔",id:1026}
            ],
            home_name:'',
            teamMatch:[],
            r_result:['胜','平','负'],
            matchID:'',
            oddsData:[],
            matchAI:[],
            alltabData:[],
            totalCount:1,
            PageSize: 10,
            pageSizes: [5, 10],
            currentPage: 1,
            wd_id:1,
            ball_id:1,
            changeTeam:{},
            selectIndex:7,
            selectIndexBask:7,
            vpoint:9,
            modifyData:{},
            modify_id:9,
            checkedAll:[],
            viewpoint_a:'',
            viewpoint_b:'',
            ballList:[{type:'足球',id:1},{type:'篮球',id:2}],
            ballID:1,
            showType:true,
            baskDataOdds:{},
            selectBaskScore:7,


            t_id:'',
            s_id:'',
            fenchaA:'',
            fenchaB:'',
            xishu:'',
            selectedItems:[],
            showOddsNull:0,

            rangfen:'',
            bigfen:'',
            horA:1,
            zhuName:'',
            keName:'',
            isFjc: false,
            updateForm: {
                name1: '',
                name2: '',
                type: 1,
                id: ''
            },
            renderDate: new Date()
        }
    },
    created(){
        // this.modify_id = this.wd_id
        this.getAIlist()
    },
    methods: {
         async modifyConfirm1() {

            if (!this.updateForm.name1 || !this.updateForm.name2) {
                this.$message.error("请检查队伍名称是否填写")
                return
            }


            let res;    

            let obj = {
                type: this.updateForm.type,
                id: this.updateForm.id,
                home_team_name: this.updateForm.name1,
                away_team_name: this.updateForm.name2
            }

            if (this.ball_id == 1) {
                res = await updateOdds1(obj);

            } else {
                res = await updateOdds(obj);

            }

            if (res.code == 1) {

                this.dialogTrue1 = false

            } else {

                this.$message.error(res.msg)

            }
            // console.log(res.data.data)
            // console.log(this.updateForm)
        },
        handleButton3Click(v){
            this.dialogTrue1 = true;
            this.updateForm.name1 = v.teamA;
            this.updateForm.name2 = v.teamB;
            this.updateForm.id = v.id;
            this.updateForm.type =this.wd_id
        },
        closedModel1() {
            this.dialogTrue1 =false;
        },
        toggleSelect(id,j) {
            console.log(id)
      const index = this.selectedItems.indexOf(id)
      if (index > -1) {
        // 如果已存在则移除
        this.selectedItems.splice(index, 1)
      } else {
        // 如果不存在则添加
        this.selectedItems.push(id)
      }
      if(this.selectedItems.length==2){
        if(this.selectedItems[0]==1){
            this.fenchaA = '1-5'
        }else if(this.selectedItems[0]==2){
            this.fenchaA = '6-10'
        }else if(this.selectedItems[0]==3){
            this.fenchaA = '11-15'
        }else if(this.selectedItems[0]==4){
            this.fenchaA = '16-20'
        }else if(this.selectedItems[0]==5){
            this.fenchaA = '21-25'
        }else if(this.selectedItems[0]==6){
            this.fenchaA = '26+'
        }
        if(this.selectedItems[1]==1){
            this.fenchaB = '1-5'
        }else if(this.selectedItems[1]==2){
            this.fenchaB = '6-10'
        }else if(this.selectedItems[1]==3){
            this.fenchaB = '11-15'
        }else if(this.selectedItems[1]==4){
            this.fenchaB = '16-20'
        }else if(this.selectedItems[1]==5){
            this.fenchaB = '21-25'
        }else if(this.selectedItems[1]==6){
            this.fenchaB = '26+'
        }
      }
      if(this.selectedItems.length==1){
        this.fenchaB = ''
        if(this.selectedItems[0]==1){
            this.fenchaA = '1-5'
        }else if(this.selectedItems[0]==2){
            this.fenchaA = '6-10'
        }else if(this.selectedItems[0]==3){
            this.fenchaA = '11-15'
        }else if(this.selectedItems[0]==4){
            this.fenchaA = '16-20'
        }else if(this.selectedItems[0]==5){
            this.fenchaA = '21-25'
        }else if(this.selectedItems[0]==6){
            this.fenchaA = '26+'
        }
      }
      console.log(this.selectedItems)
      console.log(this.fenchaA)
      console.log(this.fenchaB)
    },
        closedModel(){
            this.dialogTrue = false
        },
        handleButton1Click(e){
            console.log(e)
            this.renderDate = e.create_time
            if(this.ball_id==1){
                if(e.viewpoint==1){
                this.selectIndex=0
            }else if(e.viewpoint==3){
                this.selectIndex=1
            }else{
                this.selectIndex=2
            }
            // {label:'胜',type:false},{label:'平',type:false},{label:'负',type:false}
            if(e.viewpoint==1){
                this.modifyOdds[0].is_recommend = true
            }else if(e.viewpoint==2){
                this.modifyOdds[2].is_recommend = true
            }else if(e.viewpoint==3){
                this.modifyOdds[1].is_recommend = true
            }
            if(e.viewpointA==1){
                this.modifyOdds[0].is_recommend = true
            }else if(e.viewpointA==2){
                this.modifyOdds[2].is_recommend = true
            }else if(e.viewpointA==3){
                this.modifyOdds[1].is_recommend = true
            }
            console.log(this.modifyOdds)
            this.modifyData = e
            this.modify_id = this.wd_id
            this.vpoint=e.viewpoint
            }else{
                this.modifyData = e
                this.modify_id = this.wd_id
                if(e.outcome==2){
                    this.selectIndexBask = 2
                }
                if(e.outcome==1){
                    this.selectIndexBask = 0
                }
                hqOddsData({
                lot_lx:3,
                lx:2,
                match_id:e.match_id
            }).then(res => {
                if(res.data==null){
                    this.showType = false
                }else{
                    this.bigSmallData = res.data.odds[0]
                    console.log(this.bigSmallData)
                }
            })
            if(e.size==2){
                this.selectBaskScore=0
            }
            if(e.size==1){
                this.selectBaskScore=2
            }
            console.log(e.gapA)
            console.log(e.gapB)
            let fc1 = ''
            let fc2 = ''
            if(e.gapA=='1-5'){
                fc1 = 1
            }else if(e.gapA=='6-10'){
                fc1 = 2
            }else if(e.gapA=='11-15'){
                fc1 = 3
            }else if(e.gapA=='16-20'){
                fc1 = 4
            }else if(e.gapA=='21-25'){
                fc1 = 5
            }else if(e.gapA=='26+'){
                fc1 = 6
            }
            if(e.gapB=='1-5'){
                fc2 = 1
            }else if(e.gapB=='6-10'){
                fc2 = 2
            }else if(e.gapB=='11-15'){
                fc2 = 3
            }else if(e.gapB=='16-20'){
                fc2 = 4
            }else if(e.gapB=='21-25'){
                fc2 = 5
            }else if(e.gapB=='26+'){
                fc2 = 6
            }
            this.selectedItems.push(fc1,fc2)
            // selectedItems
            // selectBaskScore
                console.log(8888)
            }
            
            // this.viewpoint_a = e.viewpointA
            console.log(this.modify_id )
            this.dialogTrue = true
        },
        handleButton2Click(e){
            console.log(e)
            if(this.ball_id==1){
                aiListDelete({
                id:e.id,
                type:this.wd_id,
            }).then(res => {
                this.getAIlist()
            })
            }else{
                baskListDelete({
                id:e.id,
                type:this.wd_id,
            }).then(res => {
                this.getAIlist()
            })
            }
        },
        selectType(e){
            this.wd_id = e
            this.ruleForm.typeid = e
            console.log(this.wd_id)
            this.getAIlist()
        },
        changeBall(e){
            console.log(e)
            this.ball_id = e
            if(this.ball_id==1){
                aiPlayList({
                list_rows:this.PageSize,
                type:this.wd_id,
                page:this.currentPage
            }).then(res => {
                this.matchAI = res.data.data
                this.alltabData = res.data.data
                this.totalCount = res.data.total
            })
            }else{
                baskList({
                type:this.wd_id,
                ist_rows:this.PageSize,
                page:this.currentPage
            }).then(res => {
                this.matchAI = res.data.data
                this.alltabData = res.data.data
                this.totalCount = res.data.total
            })
            }
        },
        // 显示第几页
        handleCurrentChange(val) {
            // 改变默认的页数
            this.currentPage = val
            this.getAIlist()
        },
        // 分页
        // 每页显示的条数
        handleSizeChange(val) {
            // 改变每页显示的条数
            this.PageSize = val
            // 改变每页显示的条数时，要将页码显示到第一页
            this.currentPage = 1
            this.getAIlist()
        },
        handleButtonAdd(){
            console.log(999)
            this.dialogTableVisible = true
            this.renderDate = new Date()
        },
        selectChange(e){
            console.log(e)
            this.modify_id = e
            // this.wd_id = e
        },
        selectBall(e){
            console.log(e)
            this.ballID = e
            
        },
        closeForm() {
            this.dialogTableVisible = false
        },
        selectMatch(){
            console.log(this.ruleForm.matchid)
        },
        clickDelete(){
            console.log('取消')
        },
        modifyConfirm(){
            console.log(this.s_id)
            if(this.ball_id==1){
                aiSaveData({
                id:this.modifyData.id,
                type:this.wd_id,
                match_id:this.modifyData.match_id,
                teamA:this.modifyData.teamA,
                teamB:this.modifyData.teamB,
                game_time:this.modifyData.game_time,

                viewpoint:this.vpoint,
                viewpointA:this.viewpoint_a,
                if_pinned:this.modifyData.if_pinned,

                point_advantage:this.modifyData.point_advantage,
                form_advantage:this.modifyData.form_advantage,
                ranking_advantage:this.modifyData.ranking_advantage,
                head_to_head_advantage:this.modifyData.head_to_head_advantage,
                home_head_to_head_advantage:this.modifyData.home_head_to_head_advantage,

                predicted_scoreA:this.modifyData.predicted_scoreA,
                predicted_scoreB:this.modifyData.predicted_scoreB,
                historical_upset:this.modifyData.historical_upset,
                market_insight:this.modifyData.market_insight,
                index_analysis:this.modifyData.index_analysis,
                dynamic_strength:this.modifyData.dynamic_strength,
                fighting_spirit:this.modifyData.fighting_spirit,
                coefficient:this.modifyData.coefficient,
                change_score:this.ruleForm.Mscore,
                create_time: new Date(this.renderDate).getTime() / 1000
                
            }).then(res => {
                console.log(res)
                this.dialogTrue = false
                this.getAIlist()
            })
            }else{
                baskListSave({
                    id:this.modifyData.id,
                    type:this.wd_id,
                    match_id:this.modifyData.match_id,
                    teamA:this.modifyData.teamA,
                    teamB:this.modifyData.teamB,
                    game_time:this.modifyData.game_time,
                    outcome:this.modifyData.outcome,
                    size:this.modifyData.size,
                    if_pinned:this.ruleForm.plnned,
                    point_advantage:this.modifyData.point_advantage,
                    form_advantage:this.modifyData.form_advantage,
                    ranking_advantage:this.modifyData.ranking_advantage,
                    head_to_head_advantage:this.modifyData.head_to_head_advantage,
                    home_head_to_head_advantage:this.modifyData.home_head_to_head_advantage,
                gapA:this.fenchaA,
                gapB:this.fenchaB,
                coefficient:this.modifyData.coefficient,
                create_time: new Date(this.renderDate).getTime() / 1000



                
              
            }).then(res => {
                console.log(res)
                this.dialogTrue = false
                this.getAIlist()
            })
            }
        },
        clickConfirm(){
           
            this.ruleForm.total_score
            if(this.ballID==1){
                aiSaveData({
                type:this.ruleForm.typeid,
                match_id:this.matchID,
                teamA:this.changeTeam.home_team_name,
                teamB:this.changeTeam.away_team_name,
                game_time:this.changeTeam.start_time_value,
                viewpoint:this.vpoint,
                viewpointA:this.viewpoint_a,
                // this.viewpoint_a = arr[0].index
                // this.viewpoint_b = arr[1].index
                if_pinned:this.ruleForm.plnned,
                point_advantage:this.ruleForm.cs1,
                form_advantage:this.ruleForm.cs2,
                ranking_advantage:this.ruleForm.cs3,
                head_to_head_advantage:this.ruleForm.cs4,
                home_head_to_head_advantage:this.ruleForm.cs5,
                predicted_scoreA:this.ruleForm.score1,
                predicted_scoreB:this.ruleForm.score2,
                historical_upset:this.ruleForm.cs6,
                market_insight:this.ruleForm.cs7,
                index_analysis:this.ruleForm.cs8,
                dynamic_strength:this.ruleForm.cs9,
                fighting_spirit:this.ruleForm.cs10,
                coefficient:this.ruleForm.coefficient,
                change_score:this.ruleForm.Mscore,
                goalLine: this.ruleForm.goalLine,
                total_score: this.ruleForm.total_score,
                create_time: this.renderDate.getTime() / 1000
            }).then(res => {
                console.log(res)
                this.dialogTableVisible = false
                this.matchID = ''
                this.renderDate = new Date()
                this.vpoint = 9
                this.home_name = ''
                this.changeTeam = {}
                this.teamMatch = []
                Object.assign(this.ruleForm,{
                    typeid:1,
                    plnned:2,
                    cs1:'',
                    cs2:'',
                    cs3:'',
                    cs4:'',
                    cs5:'',
                    score1:'',
                    score2:'',
                    cs6:'',
                    cs7:'',
                    cs8:'',
                    cs9:'',
                    cs8:'',
                    cs10:'',
                    coefficient:'',
                })
                this.getAIlist()
            })
            }else{
                baskListSave({
                type:this.ruleForm.typeid,
                match_id:this.matchID,
                teamA:this.changeTeam.home_team_name,
                teamB:this.changeTeam.away_team_name,
                game_time:this.changeTeam.start_time_value,
                outcome:this.t_id,
                size:this.s_id,
                if_pinned:this.ruleForm.plnned,
                point_advantage:this.ruleForm.cs1,
                form_advantage:this.ruleForm.cs2,
                ranking_advantage:this.ruleForm.cs3,
                head_to_head_advantage:this.ruleForm.cs4,
                home_head_to_head_advantage:this.ruleForm.cs5,
                gapA:this.fenchaA,
                gapB:this.fenchaB,
                coefficient:this.ruleForm.coefficient,
                total_score:this.bigfen,
                goalLine:this.rangfen,
                HorA:this.horA,
                create_time: this.renderDate.getTime() / 1000
                // viewpoint:this.vpoint,
                // viewpointA:this.viewpoint_a,
                // // this.viewpoint_a = arr[0].index
                // // this.viewpoint_b = arr[1].index
                // if_pinned:this.ruleForm.plnned,
                // point_advantage:this.ruleForm.cs1,
                // form_advantage:this.ruleForm.cs2,
                // ranking_advantage:this.ruleForm.cs3,
                // head_to_head_advantage:this.ruleForm.cs4,
                // home_head_to_head_advantage:this.ruleForm.cs5,
                // predicted_scoreA:this.ruleForm.score1,
                // predicted_scoreB:this.ruleForm.score2,
                // historical_upset:this.ruleForm.cs6,
                // market_insight:this.ruleForm.cs7,
                // index_analysis:this.ruleForm.cs8,
                // dynamic_strength:this.ruleForm.cs9,
                // fighting_spirit:this.ruleForm.cs10,
                // coefficient:this.ruleForm.coefficient,
                // change_score:this.ruleForm.Mscore
            }).then(res => {
                console.log(res)
                this.dialogTableVisible = false
                this.matchID = ''
                this.vpoint = 9
                this.home_name = ''
                this.changeTeam = {}
                this.teamMatch = []
                this.bigSmallData = []
                this.renderDate = new Date()
                Object.assign(this.ruleForm,{
                    typeid:1,
                    plnned:2,
                    cs1:'',
                    cs2:'',
                    cs3:'',
                    cs4:'',
                    cs5:'',
                    score1:'',
                    score2:'',
                    cs6:'',
                    cs7:'',
                    cs8:'',
                    cs9:'',
                    cs8:'',
                    cs10:'',
                    coefficient:'',
                })
                this.getAIlist()
            })
            }
        },
        // 更新足球赔率
        upOdds(){

            if(this.ballID==1){
                footUpOdds({
                game_time:this.changeTeam.start_time_value,
                home_team_name:this.zhuName,
                away_team_name:this.keName,
            }).then(res => {
                // modifyOdds:[{label:'胜',is_recommend:false},{label:'平',is_recommend:false},{label:'负',is_recommend:false}],
                let arr = res.data.shengping
                console.log(arr)
                this.modifyOdds[0].value = arr.sheng
                    this.modifyOdds[1].value = arr.ping
                    this.modifyOdds[2].value = arr.fu

                    this.oddsData = this.modifyOdds
                    console.log(this.oddsData)
            })
            }else{

            }
        },
        getMatchList(){
            console.log(this.home_name)
            if(this.home_name==''){
                this.teamMatch = []
                this.oddsData = []
            }else{
                hqMatcheList({
                limit:10,
                lx:this.ballID,
                name:this.home_name,
                page:1
            }).then(res => {
                console.log(res)
                this.teamMatch = res.data.list.data
            })
            }
        },
        getAIlist(){
            if(this.ball_id==1){
                aiPlayList({
                list_rows:this.PageSize,
                type:this.wd_id,
                page:this.currentPage
            }).then(res => {
                this.matchAI = res.data.data
                this.alltabData = res.data.data
                this.totalCount = res.data.total
            })
            }else{
                baskList({
                type:this.wd_id,
                ist_rows:this.PageSize,
                page:this.currentPage
            }).then(res => {
                this.matchAI = res.data.data
                this.alltabData = res.data.data
                this.totalCount = res.data.total
            })
            }
        },
        getOdds(){


            console.log(this.changeTeam)
            // return
            if(this.ballID==1){
                hqOddsData({
                lot_lx:1,
                // lx:1,
                lx:this.ballID,
                match_id:this.matchID
            }).then(res => {
                // this.oddsData = res.data.odds[0].slice(1)
                // console.log(this.oddsData)
                
                
                if(res.data==null){
                    this.isFjc = true
                    this.showType = false
                    this.oddsData = [
                        {
                            label:"主胜",
                            value: "",
                            is_recommend: false
                        },
                        {
                             label:"平局",
                            value: "",
                            is_recommend: false

                        },
                        {
                             label:"客胜",
                            value: "",
                            is_recommend: false

                        }
                    ]
                    // this.oddsData = res.data
                }else{
                    this.oddsData = res.data.odds[0].slice(1)
                    
                }
            })
            }else{
                hqOddsData({
                lot_lx:3,
                // lx:1,
                lx:2,
                match_id:this.matchID
            }).then(res => {
                // this.oddsData = res.data.odds[0].slice(1)
                // console.log(this.oddsData)
                if(res.data==null){
                    this.showType = false
                    // this.oddsData = res.data
                }else{
                    this.bigSmallData = res.data.odds[0]
                    console.log(this.bigSmallData)
                }
            })
            // // hqOddsData   baskListOdds
            //     baskListOdds({
            //     // lot_lx:1,
            //     // // // lx:1,
            //     // lx:this.ballID,
            //     matchId:this.matchID
            // }).then(res => {
            //     console.log(res)
            //     this.baskDataOdds = res.data
            //     console.log(this.baskDataOdds)
            //     console.log(this.baskData)
            //     let arr = [{label: "主胜",value:"3.65"},{label: "主负",value:"3.65"}]
            //     arr[0].value = this.baskDataOdds.shengfu.sheng
            //     arr[1].value = this.baskDataOdds.shengfu.fu
            //     console.log(this.baskData)
            //     this.baskData = arr
            // })
            // hqOddsData   baskListOdds
            hqOddsData({
                lot_lx:1,
                // // lx:1,
                lx:this.ballID,
                match_id:this.matchID
            }).then(res => {
                console.log(res.data)
                if(res.data!=null){
                    this.baskDataOdds = res.data.odds[0]
                console.log(this.baskDataOdds)
                // this.rangfen = this.baskDataOdds
                // console.log(this.baskData)
                // let arr = [{label: "主胜",value:"3.65"},{label: "主负",value:"3.65"}]
                // arr[0].value = this.baskDataOdds.shengfu.sheng
                // arr[1].value = this.baskDataOdds.shengfu.fu
                console.log(this.baskData)
                this.baskData = res.data.odds[0]
                }else{
                    this.showOddsNull = 1
                }
            })
            }
        },
        toChange(id,item){
            this.matchID = id
            this.changeTeam = item
            console.log(item)
            let arr = []
            arr.push(item)
            this.teamMatch = arr
            console.log(this.teamMatch)
            this.getOdds()
        },
        onSelectBask(e,j){
            console.log(e)
            console.log(j)
            this.selectIndexBask = j
            if(j==0){
                this.t_id=2
                this.modifyData.outcome = 2
            }else if(j==2){
                this.t_id=1
                this.modifyData.outcome = 1
            }
        },
        onSelectBaskScore(e,j){
            console.log(e)
            console.log(j)
            this.selectBaskScore = j

            if(j==0){
                this.s_id=2
                this.modifyData.size = 2
            }else if(j==2){
                this.s_id=1
                this.modifyData.size = 1
            }
        },
        onSelect1(e,j) {
            if(this.ruleForm.typeid==1){
                this.selectIndex = j
            if(j==0){
                this.vpoint=1
            }else if(j==1){
                this.vpoint=3
            }else{
                this.vpoint=2
            }
            }else{
                console.log(99)
                console.log(e)
                e.is_recommend = !e.is_recommend
            this.checkedAll.push(e)
            this.checkedAll = Array.from(new Set(this.checkedAll))
            console.log(this.checkedAll)
            let arr = []
            for (var i = 0; i < this.checkedAll.length; i++) {
                // console.log(this.checkedAll[i])
                if (this.checkedAll[i].is_recommend == true) {
                    arr.push(this.checkedAll[i])
                }

            }
            arr.sort((a, b) => parseInt(a.index) - parseInt(b.index));
            console.log("这是8888",arr)
            if(arr.length>1){
                if(arr[0].is_recommend==true&&arr[1].is_recommend==true&&arr[0].label=='主胜'&&arr[1].label=='平局'){
                    this.vpoint = 1
                    this.viewpoint_a = 3
                }else if(arr[0].is_recommend==true&&arr[1].is_recommend==true&&arr[0].label=='主胜'&&arr[1].label=='客胜'){
                    this.vpoint = 1
                    this.viewpoint_a = 2
                }else if(arr[0].is_recommend==true&&arr[1].is_recommend==true&&arr[0].label=='平局'&&arr[1].label=='客胜'){
                    this.vpoint = 3
                    this.viewpoint_a = 2
                }
                // if(arr[1].is_recommend==true){
                //     this.viewpoint_a = 1
                // }else if(arr[1].is_recommend==true){
                //     this.viewpoint_a = 2
                // }else if(arr[1].is_recommend==true){
                //     this.viewpoint_a = 3
                // }
                console.log(this.viewpoint_a)
                console.log(this.vpoint)
            }else if(arr.length==1){
                if(arr[0].label=='主胜'){
                    this.vpoint = 1
                }else if(arr[0].label=='客胜'){
                    this.vpoint = 2
                }else if(arr[0].label=='平局'){
                    this.vpoint = 3
                }
                console.log(this.vpoint)
            }
            // if(arr.length>1){
            //     if(arr[0].label=='主胜'){
            //         this.vpoint = 1
            //     }else if(arr[0].label=='主负'){
            //         this.vpoint = 2
            //     }else if(arr[0].label=='平局'){
            //         this.vpoint = 3
            //     }
            //     if(arr[1].label=='主胜'){
            //         this.viewpoint_a = 1
            //     }else if(arr[1].label=='主负'){
            //         this.viewpoint_a = 2
            //     }else if(arr[1].label=='平局'){
            //         this.viewpoint_a = 3
            //     }
            //     console.log(this.viewpoint_a)
            //     console.log(this.vpoint)
            // }else if(arr.length==1){
            //     if(arr[0].label=='主胜'){
            //         this.vpoint = 1
            //     }else if(arr[0].label=='主负'){
            //         this.vpoint = 2
            //     }else if(arr[0].label=='平局'){
            //         this.vpoint = 3
            //     }
            //     console.log(this.vpoint)
            // }
            }
        },
        onSelect2(e,j){
            if(this.ruleForm.typeid==1){
                console.log(e)
                console.log(this.modifyOdds)
                this.selectIndex = j
            if(j==0){
                this.vpoint=1
            }else if(j==1){
                this.vpoint=3
            }else{
                this.vpoint=2
            }
            }else{
                console.log(99)
                console.log(e)
                e.is_recommend = !e.is_recommend
            console.log(this.modifyOdds)
            if(this.modifyOdds[0].is_recommend==true&&this.modifyOdds[1].is_recommend==true){
                    this.vpoint = 1
                    this.viewpoint_a = 3
                }else if(this.modifyOdds[0].is_recommend==true&&this.modifyOdds[2].is_recommend==true){
                    this.vpoint = 1
                    this.viewpoint_a = 2
                }else if(this.modifyOdds[1].is_recommend==true&&this.modifyOdds[2].is_recommend==true){
                    this.vpoint = 3
                    this.viewpoint_a = 2
                }else if(this.modifyOdds[0].is_recommend==true){
                    this.vpoint = 1
                }else if(this.modifyOdds[1].is_recommend==true){
                    this.vpoint = 3
                }else if(this.modifyOdds[2].is_recommend==true){
                    this.vpoint = 2
                }
                // if(arr[1].label=='主胜'){
                //     this.viewpoint_a = 1
                // }else if(arr[1].label=='主负'){
                //     this.viewpoint_a = 2
                // }else if(arr[1].label=='平局'){
                //     this.viewpoint_a = 3
                // }
            }
        }
    }
}
</script>

<style>
.cs_class{
    display: flex;
}
.box {
    display: flex;

}

.fourteenClass {
    width: 300px;
}

.fourteenClass_a {
    width: 80px;
    border: 1px solid #aaa;
    text-align: center;
    line-height: 38px;
}

.fourteenClass_a:nth-child(2) {
    border-left: none;
    border-right: none;
}
.bask_class{
    width: 80px;
    border: 1px solid #aaa;
    text-align: center;
    line-height: 38px;
}
.bask_class:nth-child(2){
    border-left: none;
    /* border-right: none; */
}
.item1 {
    background-color: #3C9CFF;
    color: #fff;
}
</style>